﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using Beeldbankmvc.Models;
using System.Web.Mvc;

namespace Beeldbankmvc.Code
{
    public class IdMapper
    {
        public static string mapReactionCategory(string Id)
        {
            string categoryDescription = "";

            IList<SelectListItem> list = ReactionModel.categoryList();

            foreach (SelectListItem item in list)
            {
                if (Id == item.Value)
                {
                    categoryDescription = item.Text;
                    break;
                }
            }

            return categoryDescription;
        }


        public static string mapReactionSubject(string Id)
        {
            string subjectDescription = "";

            IList<SelectListItem> list = ReactionModel.subjectList();

            foreach (SelectListItem item in list)
            {
                if (Id == item.Value)
                {
                    subjectDescription = item.Text;
                    break;
                }
            }

            return subjectDescription;
        }

        public static string mapReactionStatusName(int Id)
        {
            string subjectDescription = "";

            ReactionStatusRepository statusRep = new ReactionStatusRepository();

            subjectDescription = statusRep.FindOne(Id).Name;
  
            return subjectDescription;
        }



    }
}